const state = {
	tagNames: []
}
const mutations = {
	// 更新开发环境配置
	updateDevOpts(state, parms) {
		state.devOpts = Object.assign(state.devOpts, parms)
		window.sessionStorage.setItem('devOpts', JSON.stringify(state.devOpts))
	},
    addTagNames(state, tagName) {
        if (tagName && state.tagNames.tags.indexOf(tagName) == -1) {
            state.tagNames.tags.push(tagName)
        }
    }
}

const getters = {
    getTagNames() {
        return state.tagNames
    }
}

const actions = {}
// 初始化开发配置
let devOpts = JSON.parse(window.sessionStorage.getItem('devOpts') || '{}')
mutations.updateDevOpts(state, devOpts)

export default {
	namespaced: true,
	state,
	mutations,
	actions,
    getters
}
